# 汇编、链接bootsect.bin
if [ -n "$1" ]; then
as -o bootsect.o $1
else
as -o bootsect.o bootsect.s
fi

if [ -n "$2" ]; then
ld --oformat binary -Ttext=$2 -o bootsect.bin bootsect.o
else
ld --oformat binary -Ttext=0 -o bootsect.bin bootsect.o
fi

# 制作硬盘镜像文件
dd if=/dev/zero of=../c.img bs=512 count=2048
dd if=bootsect.bin of=../c.img bs=512 seek=0 conv=notrunc
#dd if=bootsect.bin of=../c.img bs=512 seek=0  skip=62 conv=notrunc
